/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package smallcms.usermgt;

import javax.inject.Named;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import smallcms.entity.Members;
import smallcms.entity.User;

/**
 *
 * @author hr1ur093
 */
@Named(value = "userManagedBean")
@RequestScoped
public class UserManagedBean {

    @Inject
    UserBean ub;
    
    /**
     * Creates a new instance of UserManagedBean
     */
    public UserManagedBean() {
    }
    private String firstName;

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
    
    public String registerUser() {
        User usr = new User();
        Members mmbr = new Members();
        usr.setUserName("Pero");
        usr.setPassword("Pero123");
        //mmbr.setFirstName("Pero");
        //mmbr.setLastName("Peric");
        //mmbr.setUseruserName(usr);
        //usr.setMembers(mmbr);
        ub.createUser(usr);
        return "success";
    }
}
